﻿29.4.2013 19:41:42
select * from [User] where nameLogin = @nameLogin and password = @password

29.4.2013 19:41:42
INSERT INTO Login ( idUser, 
login, 
idApplication) VALUES (  1, 
 to_date('29.4.2013 19:41:42', 'dd/mm/yyyy hh24:mi:ss'), 
 2) ; SELECT @@Identity

29.4.2013 19:41:43
DECLARE @idRole int = 1;--1 
select Modul.*, UserAdd.nameLogin as UserNameAdd, UserMod.nameLogin as UserNameMod  
from Modul 
left join [User] as UserAdd on Modul.userAdd = UserAdd.idUser 
left join [User] as UserMod on Modul.userMod = UserMod.idUser 
where 
idModul not in 
(
--Select vraci vsechny idModul, ktere maji byt neviditelne pro danou roli 
select Modul.idModul 
from Modul 
left join Rights on Modul.idModul = Rights.idModul 
where Rights.idRole = @idRole and visible = 0 
) 
order by idParent, orderModul

29.4.2013 19:41:45
select * from Rights where idRole = 1 and idModul = 4

29.4.2013 19:41:45
select * from Dotaznik

29.4.2013 19:41:45
IF COL_LENGTH('DOTAZNIK','lock') IS NULL
Select 'Tabulka nepouziva uzamykani.' as 'Result';

29.4.2013 19:42:09
UPDATE Login SET 
logout = to_date('29.4.2013 19:42:09', 'dd/mm/yyyy hh24:mi:ss')
 WHERE idLogin = 349 

